C SIMPLE EXAMPLE OF USE OF MA27 PACKAGE
      INTEGER IRN(10),ICN(10),IW(40),IKEEP(15)
      INTEGER IW1(10),ICNTL(30),INFO(20)
      INTEGER LIW,LA,IFLAG,N,NZ,I,NSTEPS,MAXFRT
      REAL A(30),W(5),RHS(5),CNTL(5),OPS
C
C INITIALIZE MA27
      CALL MA27I(ICNTL,CNTL)
C
C STORE ARRAY LENGTHS
      LIW = 40
      LA  = 30
C
C ASK FOR FULL PRINTING FROM MA27 PACKAGE
      ICNTL(3) = 2
C
C SET IFLAG TO INDICATE PIVOT SEQUENCE IS TO BE FOUND BY MA27AD
      IFLAG = 0
C
C READ MATRIX AND RIGHT-HAND SIDE
      READ (5,*) N,NZ
      READ (5,*) (IRN(I),ICN(I),A(I),I=1,NZ)
      READ (5,*) (RHS(I),I=1,N)
C
C ANALYSE SPARSITY PATTERN
      CALL MA27A(N,NZ,IRN,ICN,IW,LIW,IKEEP,IW1,NSTEPS,IFLAG,
     +            ICNTL,CNTL,INFO,OPS)
C
C FACTORIZE MATRIX
      CALL MA27B(N,NZ,IRN,ICN,A,LA,IW,LIW,IKEEP,NSTEPS,MAXFRT,
     *            IW1,ICNTL,CNTL,INFO)
C
C SOLVE THE EQUATIONS
      CALL MA27C(N,A,LA,IW,LIW,W,MAXFRT,RHS,IW1,NSTEPS,ICNTL,
     +           INFO)
      STOP
      END
